import api from '@/utils/request'

export default {
  loginAPI(data) {
    return api.post(
      '/login/',
      data
    )
  },
  logoutAPI(data) {
    return api.post(
      '/logout/',
      data
    )
  },
  registerAPI(data) {
    return api.post(
      '/customer-service/',
      data
    )
  },
  //客服
  getAllCustomerServiceAPI(params) {
    return api.get(
      `/customer-service/`,
      params
    )
  },
  getCustomerServiceAPI(params) {
    return api.get(
      `/customer-service/${params}`
    )
  },
  updateCustomerServiceAPI(data) {
    return api.put(
      `/customer-service/${data.customerServiceId}`,
      data
    )
  },
  createCustomerServiceAPI(data) {
    return api.post(
      '/customer-service/',
      data
    )
  },
  partialUpdateCustomerServiceAPI(data) {
    return api.put(
      `/customer-service/${data.customerServiceId}/partial`,
      data
    )
  },
  partialDeleteCustomerServiceAPI(params) {
    return api.delete(
      `/customer-service/${params}/deletePartial/`
    )
  },
  deleteCustomerServiceAPI(params) {
    return api.delete(
      `/customer-service/${params}`
    )
  },


  //通知公告
  getAllAnnouncementAPI(params) {
    return api.get(
      `/notice/`,
      params
    )
  },
  getAnnouncementAPI(params) {
    return api.get(
      `/notice/${params}`
    )
  },
  updateAnnouncementAPI(data) {
    return api.put(
      `/notice/${data.id}`,
      data
    )
  },
  createAnnouncementAPI(data) {
    return api.post(
      `/notice/`,
      data
    )
  },
  deleteAnnouncementAPI(params) {
    return api.delete(
      `/notice/${params}`
    )
  },
  partialDeleteAnnouncementAPI(params) {
    return api.delete(
      `/notice/${params}/deletePartial/`
    )
  },


  //客服组
  getAllGroupAPI(params) {
    return api.get(
      `/group-manage/`,
      params
    )
  },
  createGroupAPI(data) {
    return api.post(
      '/group-manage/',
      data
    )
  },
  updateGroupAPI(data) {
    return api.put(
      `/group-manage/${data.groupId}`,
      data
    )
  },
  deleteGroupAPI(params) {
    return api.delete(
      `/group-manage/${params}`
    )
  },
  partialDeleteGroupAPI(params) {
    return api.delete(
      `/group-manage/${params}/deletePartial/`
    )
  },


  //角色
  getAllRoleAPI(params) {
    return api.get(
      `/role-manage/`,
      params
    )
  },
  createRoleAPI(data) {
    return api.post(
      '/role-manage/',
      data
    )
  },
  updateRoleAPI(data) {
    return api.put(
      `/role-manage/${data.roleId}`,
      data
    )
  },
  deleteRoleAPI(params) {
    return api.delete(
      `/role-manage/${params}`
    )
  },
  partialDeleteRoleAPI(params) {
    return api.delete(
      `/role-manage/${params}/deletePartial/`
    )
  },


  //客户
  getAllCustomerAPI(params) {
    return api.get(
      `/customer-info/`,
      params
    )
  },
  getCustomerAPI(params) {
    return api.get(
      `/customer-info/${params}`
    )
  },
  getCustomer2API(data){
    return api.post(
      `/customer-info/condition`,
      data
    )
  },
  createCustomerAPI(data) {
    return api.post(
      '/customer-info/',
      data
    )
  },
  updateCustomerAPI(data) {
    return api.put(
      `/customer-info/${data.id}`,
      data
    )
  },
  deleteCustomerAPI(params) {
    return api.delete(
      `/customer-info/${params}`
    )
  },
  partialDeleteCustomerAPI(params) {
    return api.delete(
      `/customer-info/${params}/deletePartial/`
    )
  },


  //标签
  getAllTagAPI(params) {
    return api.get(
      `/tags/`,
      params
    )
  },
  createTagAPI(data) {
    return api.post(
      '/tags/',
      data
    )
  },
  updateTagAPI(data) {
    return api.put(
      `/tags/${data.id}`,
      data
    )
  },
  deleteTagAPI(params) {
    return api.delete(
      `/tags/${params}`
    )
  },
  partialDeleteTagAPI(params) {
    return api.delete(
      `/tags/${params}/deletePartial/`
    )
  },

  //黑名单
  getAllBlackListAPI(params) {
    return api.post(
      `/black-list/with-customer-info`,
      params.data
    )
  },
  getBlackListAPI(params){
    return api.get(
      `/black-list/customer/${params.customerId}`,
      params
    )
  },
  createBlackListAPI(data) {
    return api.post(
      '/black-list/',
      data
    )
  },
  updateBlackListAPI(data) {
    return api.put(
      `/black-list/${data.customerId}`,
      data
    )
  },
  deleteBlackListAPI(params) {
    return api.delete(
      `/black-list/${params}`
    )
  },
  partialDeleteBlackListAPI(params) {
    return api.delete(
      `/black-list/${params}/deletePartial/`
    )
  },


  //常用语
  getAllCommonWordAPI(params) {
    return api.get(
      `/common-word/`,
      params
    )
  },
  createCommonWordAPI(data) {
    return api.post(
      '/common-word/',
      data
    )
  },
  updateCommonWordAPI(data) {
    return api.put(
      `/common-word/${data.id}`,
      data
    )
  },
  deleteCommonWordAPI(params) {
    return api.delete(
      `/common-word/${params}`
    )
  },
  //系统消息
  getAllSysMessageAPI(params) {
    return api.get(
      `/system-message/`,
      params
    )
  },
  createSysMessageAPI(data) {
    return api.post(
      '/system-message/',
      data
    )
  },
  updateSysMessageAPI(data) {
    return api.put(
      `/system-message/${data.id}`,
      data
    )
  },
  deleteSysMessageAPI(params) {
    return api.delete(
      `/system-message/${params}`
    )
  },

  getAllWorkQualityDataAPI(params) {
    return api.get(
      `/work-quality-statistics/`,
      params
    )
  },
  createWorkQualityDataAPI(data) {
    return api.post(
      '/work-quality-statistics/',
      data
    )
  },
  updateWorkQualityDataAPI(data) {
    return api.put(
      `/work-quality-statistics/${data.id}`,
      data
    )
  },
  deleteWorkQualityDataAPI(params) {
    return api.delete(
      `/work-quality-statistics/${params}`
    )
  },
  getAllWorkLoadDataAPI(params) {
    return api.get(
      `/workload-statistics/`,
      params
    )
  },
  createWorkLoadDataAPI(data) {
    return api.post(
      '/workload-statistics/',
      data
    )
  },
  updateWorkLoadDataAPI(data) {
    return api.put(
      `/workload-statistics/${data.id}`,
      data
    )
  },
  deleteWorkLoadDataAPI(params) {
    return api.delete(
      `/workload-statistics/${params}`
    )
  },
  getAllAttendanceDataAPI(params) {
    return api.get(
      `/attendance-statistics/`,
      params
    )
  },
  createAttendanceDataAPI(data) {
    return api.post(
      '/attendance-statistics/',
      data
    )
  },
  updateAttendanceDataAPI(data) {
    return api.put(
      `/attendance-statistics/${data.id}`,
      data
    )
  },
  deleteAttendanceDataAPI(params) {
    return api.delete(
      `/attendance-statistics/${params}`
    )
  },
  getAllViewDataAPI(params) {
    return api.get(
      `/view-statistics/`,
      params
    )
  },
  createViewDataAPI(data) {
    return api.post(
      '/view-statistics/',
      data
    )
  },
  updateViewDataAPI(data) {
    return api.put(
      `/view-statistics/${data.id}`,
      data
    )
  },
  deleteViewDataAPI(params) {
    return api.delete(
      `/view-statistics/${params}`
    )
  },
  getAllWorkLogAPI(params) {
    return api.get(
      `/work-log/`,
      params
    )
  },
  createWorkLogAPI(data) {
    return api.post(
      '/work-log/',
      data
    )
  },
  updateWorkLogAPI(data) {
    return api.put(
      `/work-log/${data.id}`,
      data
    )
  },
  deleteWorkLogAPI(params) {
    return api.delete(
      `/work-log/${params}`
    )
  },
  // 工单
  getAllOrderAPI(params) {
    return api.get(
      `/work-order/`,
      params
    )
  },
  createOrderAPI(data) {
    return api.post(
      '/work-order/',
      data
    )
  },
  getOrderAPI(params) {
    return api.get(
      `/work-order/condition`,
      params
    )
  },
  getOrder2API(params) {
    return api.get(
      `/work-order/${params}/connect`
    )
  },
  getOrder3API(data) {
    return api.post(
      `/work-order/condition`,
       data
    )
  },
  getHistoryOrderAPI(params) {
    return api.get(
      `/work-order/customer/${params.customerId}`,
      params
    )
  },
  updateOrderAPI(data) {
    return api.put(
      `/work-order/${data.id}`,
      data
    )
  },
  //访客
  getAllVisitorAPI(params) {
    return api.get(
      `/visitor-info/`,
      params
    )
  },
  getVisitorAPI(params) {
    return api.get(
      `/visitor-info/${params}/`
    )
  },
  getAggregationAPI() {
    return api.get(
      `/workload-statistics/aggregation`
    )
  },
  createVisitorAPI(data) {
    return api.post(
      '/visitor-info/',
      data
    )
  },
  getSessionMessageAPI(params) {
    return api.get(
      `/session-message/in/${params}/`
    )
  },
  getHistorySessionAPI(params) {
    return api.get(
      `/session/customer-service/${params.customerServiceId}/history`,
      {
        page: params.page,
        limit: params.limit
      }
    )
  },
  getSessionAPI(params) {
    return api.get(
      `/session/${params}/`
    )
  },
  updateSessionAPI(data) {
    return api.put(
      `/session/${data.sessionId}/partial`,
      data
    )
  },
  //上传文件
  uploadFileAPI(data) {
    return api.upload(
      `/upload/file/`,
      data
    )
  }
}

